import request from '@/utils/iasRequest'

export function batchUpdateItem(val) {
  return request({
    url: '/change-item/batchUpdateItem',
    method: 'post',
    data: val
  })
}

export function batchChangeBuyer(val, changeBuyerId) {
  return request({
    url: '/change-item/batchChangeBuyer',
    method: 'post',
    data: { ids: val, changeBuyerId: changeBuyerId }
  })
}

export function batchAuditFieldAgree(val) {
  return request({
    url: '/change-item/batchAuditFieldAgree',
    method: 'post',
    data: { ids: val }
  })
}

export function batchAuditFieldReject(val, rejectRemark) {
  return request({
    url: '/change-item/batchAuditFieldReject',
    method: 'post',
    data: { ids: val, rejectMsg: rejectRemark }
  })
}

export function batchCreateFieldItem(val) {
  return request({
    url: '/change-item/batchCreateFieldItem',
    method: 'post',
    data: val
  })
}

export function batchCreateIXIUItem(val) {
  return request({
    url: '/change-item/batchCreateIXIUItem',
    method: 'post',
    data: val
  })
}

export function queryItemByItemNbr(val) {
  return request({
    url: '/change-item/queryItemByItemNbr',
    method: 'post',
    data: val
  })
}

export function queryIXIUItemInfo(val) {
  return request({
    url: '/change-item/queryIXIUItemInfo',
    method: 'post',
    data: val
  })
}

export function queryTraitItemInfo(val) {
  return request({
    url: '/change-item/queryTraitItemInfo',
    method: 'post',
    data: val
  })
}

export function batchCreateTraitItem(val) {
  return request({
    url: '/change-item/batchCreateTraitItem',
    method: 'post',
    data: val
  })
}

export function batchCreatePLUItem(val) {
  return request({
    url: '/change-item/batchCreatePLUItem',
    method: 'post',
    data: val
  })
}

export function batchCreateStatusItem(val) {
  return request({
    url: '/change-item/batchCreateStatusItem',
    method: 'post',
    data: val
  })
}

export function batchCreateDeletionItem(val) {
  return request({
    url: '/change-item/batchCreateDeletionItem',
    method: 'post',
    data: val
  })
}

export function queryPLUList(val) {
  return request({
    url: '/change-item/queryPLUList',
    method: 'post',
    data: val
  })
}

export function uploadFile(data) {
  return request({
    url: '/change-item/uploadFile',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'put',
    timeout: 600000,
    data
  })
}

export function queryDeletionItemInfo(val) {
  return request({
    url: '/change-item/queryDeletionItemInfo',
    method: 'post',
    data: val
  })
}

export function submitBPMS(val) {
  return request({
    url: '/change-item/submitBPMS',
    method: 'post',
    timeout: 600000,
    data: val
  })
}

export function batchValidate(val) {
  return request({
    url: '/change-item/batchValidate',
    method: 'post',
    timeout: 600000,
    data: val
  })
}

export function queryList(val) {
  return request({
    url: '/change-item/queryList',
    method: 'post',
    data: val
  })
}

export function batchMDAAuditAgree(val) {
  return request({
    url: '/change-item/batchMDAAuditAgree',
    method: 'post',
    data: { ids: val }
  })
}

export function batchMDAAuditReject(val, changeType, rejectRemark) {
  return request({
    url: '/change-item/batchMDAAuditReject',
    method: 'post',
    data: { ids: val, changeType: changeType, rejectMsg: rejectRemark }
  })
}

export function batchItemFileAuditAgree(val, changeType) {
  return request({
    url: '/change-item/batchItemFileAuditAgree',
    method: 'post',
    data: { batchRecordId: val, changeType: changeType }
  })
}

export function batchItemFileAuditReject(val, changeType, rejectRemark) {
  return request({
    url: '/change-item/batchItemFileAuditReject',
    method: 'post',
    data: { batchRecordId: val, changeType: changeType, rejectMsg: rejectRemark }
  })
}

export function batchUpdateFilePath(val) {
  return request({
    url: '/change-item/batchUpdateFilePath',
    method: 'post',
    data: val
  })
}

export function uploadExcel(data) {
  return request({
    url: '/change-item/uploadExcel',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'put',
    timeout: 600000,
    data
  })
}

export function setMDAReadTag(val) {
  return request({
    url: '/change-item/setMDAReadTag',
    method: 'post',
    data: { ids: val }
  })
}

export function deleteItem(val, rejectMsg) {
  return request({
    url: '/change-item/deleteItem',
    method: 'post',
    data: { ids: val, rejectMsg: rejectMsg }
  })
}
